<#include "/public/macro.html">
<div class="uk-layui-form">
	<form class="layui-form uk-form" action="/admin/callcenter/ivr/update.html" data-toggle="ajax-form" data-inner="#callCenterContent">
		<input type="hidden" name="hostid" value="${pbxHost.id!''}"> 
		<input type="hidden" name="id" value="${extention.id!''}">
		<#if ismy?? && ismy>
		<input type="hidden" name="ismy" value="true">
		</#if>
		<div class="layui-collapse">
			<div class="layui-colla-item">
				<h2 class="layui-colla-title">基本信息<font color="red">（带*表示必填项）</font></h2>
				<div class="layui-colla-content layui-show">
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label">分机号：</label>
							<div class="layui-input-inline">
								<input type="text" name="extention" disabled="disabled" required lay-verify="required|number" value="${extention.extention!''}" placeholder="请输入分机号码" autocomplete="off" class="layui-input">
							</div>
						</div>
					</div>
					<#--<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label">语种/方言：</label>
							<div class="layui-input-inline">
								<@select2 "com.dic.sales.lang" "language" extention.language " " "" "请选择语种/方言"/>
							</div>
						</div>
					</div>-->
				</div>
			</div>
			<div class="layui-colla-item">
				<h2 class="layui-colla-title">其他信息</h2>
				<div class="layui-colla-content layui-show">
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label">欢迎提示语音<a id="scheme_1" href="javacript:void(0);"  onmouseenter="subtips=layer.tips('进入IVR时播放的语音', '#scheme_1',{tips:[1,'#ff6700'],time: 30000});" onmouseleave="layer.close(subtips);" >
								<i class="layui-icon layui-icon-about" style="font-size: 16px;"></i>  
							</a><font color="red">*</font>：
							</label>
							<div class="layui-input-inline">
								<select name="greetlong" >
									<option value="" >请选择</option>
									<#if mediaList?? && mediaList?size gt 0>
									<#list mediaList as media>
									<option value="${media.id!''}" <#if media.id?? && extention.greetlong==media.id>selected</#if>>${media.name!''}</option>
									</#list>
									</#if>
								</select>
							</div>
						</div>
						<div class="layui-inline">
							<label class="layui-form-label">欢迎提示短语音<a id="scheme_2" href="javacript:void(0);"  onmouseenter="subtips=layer.tips('按键超时无响应时播放的语音', '#scheme_2',{tips:[1,'#ff6700'],time: 30000});" onmouseleave="layer.close(subtips);" >
								<i class="layui-icon layui-icon-about" style="font-size: 16px;"></i>  
							</a><font color="red">*</font>：</label>
							<div class="layui-input-inline">
								<select name="greetshort">
									<option value="" >请选择</option>
									<#if mediaList?? && mediaList?size gt 0>
									<#list mediaList as media>
									<option value="${media.id!''}" <#if media.id?? && extention.greetshort==media.id>selected</#if>>${media.name!''}</option>
									</#list>
									</#if>
								</select>
							</div>
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label">无效输入提示语音<a id="scheme_3" href="javacript:void(0);"  onmouseenter="subtips=layer.tips('按键输入错误时的提示语音', '#scheme_3',{tips:[1,'#ff6700'],time: 30000});" onmouseleave="layer.close(subtips);" >
								<i class="layui-icon layui-icon-about" style="font-size: 16px;"></i>  
							</a><font color="red">*</font>：
							</label>
							<div class="layui-input-inline">
								<select name="invalidsound" >
									<option value="" >请选择</option>
									<#if mediaList?? && mediaList?size gt 0>
									<#list mediaList as media>
									<option value="${media.id!''}" <#if media.id?? && extention.invalidsound==media.id>selected</#if>>${media.name!''}</option>
									</#list>
									</#if>
								</select>
							</div>
						</div>
						<div class="layui-inline">
							<label class="layui-form-label">离开语音<a id="scheme_4" href="javacript:void(0);"  onmouseenter="subtips=layer.tips('退出IVR导航菜单的提示语音', '#scheme_4',{tips:[1,'#ff6700'],time: 30000});" onmouseleave="layer.close(subtips);" >
								<i class="layui-icon layui-icon-about" style="font-size: 16px;"></i>  
							</a><font color="red">*</font>：</label>
							<div class="layui-input-inline" >
								<select name="exitsound" >
									<option value="" >请选择</option>
									<#if mediaList?? && mediaList?size gt 0>
									<#list mediaList as media>
									<option value="${media.id!''}" <#if media.id?? && extention.exitsound==media.id>selected</#if>>${media.name!''}</option>
									</#list>
									</#if>
								</select>
							</div>
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label">转接语音<a id="scheme_13" href="javacript:void(0);"  onmouseenter="subtips=layer.tips('transfer-sound', '#scheme_13',{tips:[1,'#ff6700'],time: 30000});" onmouseleave="layer.close(subtips);" >
								<i class="layui-icon layui-icon-about" style="font-size: 16px;"></i>  
							</a><font color="red">*</font>：
							</label>
							<div class="layui-input-inline">
								<select name="ttsvoice" >
									<option value="" >请选择</option>
									<#if mediaList?? && mediaList?size gt 0>
									<#list mediaList as media>
									<option value="${media.id!''}" <#if media.id?? && extention.ttsvoice==media.id>selected</#if>>${media.name!''}</option>
									</#list>
									</#if>
								</select>
							</div>
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label">确认宏指令<a id="scheme_5" href="javacript:void(0);"  onmouseenter="subtips=layer.tips('确认宏', '#scheme_5',{tips:[1,'#ff6700'],time: 30000});" onmouseleave="layer.close(subtips);" >
								<i class="layui-icon layui-icon-about" style="font-size: 16px;"></i>  
							</a>：
							</label>
							<div class="layui-input-inline">
								<input type="text" name="confirmmacro" value="${extention.confirmmacro!''}" placeholder="请输入确认宏指令" autocomplete="off" class="layui-input">
							</div>
						</div>
						<div class="layui-inline">
							<label class="layui-form-label">确认按键<a id="scheme_6" href="javacript:void(0);"  onmouseenter="subtips=layer.tips('当输完数字后的确认符号', '#scheme_6',{tips:[1,'#ff6700'],time: 30000});" onmouseleave="layer.close(subtips);" >
								<i class="layui-icon layui-icon-about" style="font-size: 16px;"></i>  
							</a>：</label>
							<div class="layui-input-inline">
								<select name="confirmkey">
									<#list 0..9 as sortindex>
									<option value="${sortindex}" <#if extention.confirmkey==sortindex>selected</#if>>${sortindex}</option>
									</#list>
									<option value="#" <#if extention.confirmkey=='#'>selected</#if>>#</option>
									<option value="*" <#if extention.confirmkey=='*'>selected</#if>>*</option>
								</select>
							</div>
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label">超时时间(秒)<a id="scheme_7" href="javacript:void(0);"  onmouseenter="subtips=layer.tips('当输入确认数字播放完确认音乐后的等待毫秒数', '#scheme_7',{tips:[1,'#ff6700'],time: 30000});" onmouseleave="layer.close(subtips);" >
								<i class="layui-icon layui-icon-about" style="font-size: 16px;"></i>  
							</a>：</label>
							<div class="layui-input-inline">
								<input type="text" name="timeout" value="<#if ivrMenu?? && ivrMenu.timeout??>${ivrMenu.timeout/1000}<#else>10</#if>" lay-verify="number"  placeholder="请输入超时时间" autocomplete="off" class="layui-input">
							</div>
						</div>
						<div class="layui-inline">
							<label class="layui-form-label">呼叫等待超时(秒)<a id="scheme_8" href="javacript:void(0);"  onmouseenter="subtips=layer.tips('等待选项的超时毫秒数', '#scheme_8',{tips:[1,'#ff6700'],time: 30000});" onmouseleave="layer.close(subtips);" >
								<i class="layui-icon layui-icon-about" style="font-size: 16px;"></i>  
							</a>：
							</label>
							<div class="layui-input-inline">
								<input type="text" name="interdigittimeout" value="<#if ivrMenu?? && ivrMenu.interdigittimeout??>${ivrMenu.interdigittimeout/1000}<#else>2</#if>" lay-verify="number" value="2" placeholder="请输入呼叫等待超时" autocomplete="off" class="layui-input">
							</div>
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label">最大失败次数<a id="scheme_9" href="javacript:void(0);"  onmouseenter="subtips=layer.tips('菜单结束前允许的输入数字错误的最大次数 (默认为3次，小于1为禁止失败)', '#scheme_9',{tips:[1,'#ff6700'],time: 30000});" onmouseleave="layer.close(subtips);" >
								<i class="layui-icon layui-icon-about" style="font-size: 16px;"></i>  
							</a>：</label>
							<div class="layui-input-inline">
								<select name="maxfailures">
									<#list 0..30 as sortindex>
									<option value="${sortindex}" <#if extention.maxfailures==sortindex>selected</#if>>${sortindex}</option>
									</#list>
								</select>
							</div>
						</div>
						<div class="layui-inline">
							<label class="layui-form-label">最大超时次数<a id="scheme_10" href="javacript:void(0);"  onmouseenter="subtips=layer.tips('菜单结束前允许的最大超时重试次数 (默认为max_failures的值或者是3。小于0则禁止重试).', '#scheme_10',{tips:[1,'#ff6700'],time: 30000});" onmouseleave="layer.close(subtips);" >
								<i class="layui-icon layui-icon-about" style="font-size: 16px;"></i>  
							</a>：
							</label>
							<div class="layui-input-inline">
								<select name="maxtimeouts">
									<#list 0..30 as sortindex>
									<option value="${sortindex}" <#if extention.maxtimeouts==sortindex>selected</#if>>${sortindex}</option>
									</#list>
								</select>
							</div>
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label">数字按键长度<a id="scheme_11" href="javacript:void(0);"  onmouseenter="subtips=layer.tips('允许的最大数字输入个数', '#scheme_11',{tips:[1,'#ff6700'],time: 30000});" onmouseleave="layer.close(subtips);" >
								<i class="layui-icon layui-icon-about" style="font-size: 16px;"></i>  
							</a>：</label>
							<div class="layui-input-inline">
								<select name="digitlen">
									<#list 1..20 as sortindex>
									<option value="${sortindex}" <#if extention.digitlen==sortindex>selected</#if>>${sortindex}</option>
									</#list>
								</select>
							</div>
						</div>
						<div class="layui-inline">
							<label class="layui-form-label">指令：<a id="scheme_12" href="javacript:void(0);"  onmouseenter="subtips=layer.tips('备用参数', '#scheme_12',{tips:[1,'#ff6700'],time: 30000});" onmouseleave="layer.close(subtips);" >
								<i class="layui-icon layui-icon-about" style="font-size: 16px;"></i>  
							</a>：
							</label>
							<div class="layui-input-inline">
								<input type="text" name="action" value="${extention.action!''}"  placeholder="请输入指令" autocomplete="off" class="layui-input">
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>

		<div class="layui-form-button">
			<div class="layui-button-block">
				<button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
				<button type="reset" class="layui-btn layui-btn-primary">重置</button>
			</div>
		</div>
	</form>
</div>
<script>
	layui.use('form', function(){
	  var form = layui.form;
	  form.render();
	  form.on('select(type)', function(data){
		  console.log(data.value); //得到被选中的值
		  if(data.value=='menuexecapp'){
			  $("#typeparam").attr("lay-verify","required");
			  $("#typeparam").show();
			  $("#menuplaysoundfile").hide();
			  form.render();
		  }else if(data.value=='menuplaysound'){
			  $("#typeparam").removeAttr("lay-verify");
			  $("#typeparam").val("");
			  $("#typeparam").hide();
			  $("#menuplaysoundfile").show();
			  form.render('select');
		  }else{
			  $("#typeparam").removeAttr("lay-verify");
			  $("#typeparam").val("");
			  $("#typeparam").hide();
			  $("#menuplaysoundfile").hide();
			  form.render();
		  }
		});  
	});
</script>